package org.agile.calculator;

public class Calculator {

	public static int add(int valueA, int valueB) throws IllegalArgumentException {
		checkNegativeNumber(valueA);
		checkNegativeNumber(valueB);
		
		return valueA + valueB;
	}

	public static int substract(int valueA, int valueB) {
		return valueA - valueB;
	}

	private static void checkNegativeNumber(int number) {
		if (number < 0)
			throw new IllegalArgumentException("Negative numbers are not accepted");
	}
	
}
